package yanc.app

class News {
    String id
    Date createDate
    Date modifyDate
    String title
    String subTitle
    String creator
    String content
    Integer orders
    Boolean status
    static hasMany = [typess: Types]
    /**
     * 映射。
     */
    static mapping = {
        table "sys_comm"
        version false
        id(column: "id", sqlType: "varchar(32)", generator: 'assigned')
        createDate(column: "create_date", sqlType: "datetime")
        modifyDate(column: "modify_date", sqlType: "datetime")
        title(column: "title", sqlType: "varchar(64)")
        subTitle(column: "sub_title", sqlType: "varchar(64)")
        creator(column: "creator", sqlType: "varchar(32)")
        content(column: "content", sqlType: "longtext")
        orders(column: "orders", sqlType: "int")
        status(column: "status", sqlType: "tinyint(1)")
    }

    static constraints = {
        id(nullable: false, unique: false)
        createDate(nullable: false, unique: false)
        modifyDate(nullable: false, unique: false)
        title(nullable: false, unique: false)
        subTitle(nullable: true, unique: false)
        creator(nullable: true, unique: false)
        content(nullable: false, unique: false)
        orders(nullable: true, unique: false)
        status(nullable: false, unique: false)
    }
}
